# Contributor: Jakob Meier <comcloudway@ccw.icu>
# Maintainer: Jakob Meier <comcloudway@ccw.icu>
pkgname=normaliz
pkgver=3.10.1
pkgrel=0
pkgdesc="Normaliz is an open source tool for computations."
url="https://www.normaliz.uni-osnabrueck.de/"
# s390x: flint, libarb, libantic
arch="all !s390x"
license="GPL-3.0"
makedepends="
	boost-dev
	diffutils
	flint-dev
	gmp-dev
	libantic-dev
	libarb-dev
	"
subpackages="$pkgname-dev $pkgname-libs"
source="
	normaliz-$pkgver.tar.gz::https://github.com/Normaliz/Normaliz/releases/download/v$pkgver/normaliz-$pkgver.tar.gz
	fix-timeval.patch
	fix-32bit-tests.patch
	"

build() {
	# math
	export CFLAGS="$CFLAGS -O3 -flto=auto"
	export CXXFLAGS="$CXXFLAGS -O3 -flto=auto"

	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var \
		--disable-static

	make
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="
363ee2c9388d0c88181742399be1d9bd21b27394a306ce095382f60fb8544a39feea7d10ce2bce1edf0ba6407c9bd1becc237ef1a58c7509e84e1b9f2712ba0c  normaliz-3.10.1.tar.gz
f7e81a6ad4d0e7994b65d81cf7c663eed5eb5c6c07557fbf4b8eefaa7b49c5a172fa1e36270d229bc895eb108530e669339b9989a29f9aa72b04b45353feba44  fix-timeval.patch
97246d69103964cbb9a61ee9ec12b6596b07e46d7f2119811dd24c92ee8f2c495bd3338998c1fb6c6103d484b58129d0843711bc4b23ba8e235fc26bf75a3a69  fix-32bit-tests.patch
"
